package com.cskaoyan.mapper;

import com.cskaoyan.bean.Category;
import com.cskaoyan.bean.CategoryBO;
import com.cskaoyan.bean.CategoryExample;
import com.cskaoyan.bean.CategoryL1;
import com.cskaoyan.bean.goods.CategoryList;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface CategoryMapper {
    long countByExample(CategoryExample example);

    int deleteByExample(CategoryExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Category record);

    int insertSelective(Category record);

    List<Category> selectByExample(CategoryExample example);

    Category selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Category record, @Param("example") CategoryExample example);

    int updateByExample(@Param("record") Category record, @Param("example") CategoryExample example);

    int updateByPrimaryKeySelective(Category record);

    int updateByPrimaryKey(Category record);

    List<CategoryBO> selectIdAndName();

    List<CategoryL1> selectCategoryL1(@Param("level") String level);

    List<Category> selectCategory(@Param("id") int id);

    Map selectCategoryIds(@Param("id") Integer id);

    List<CategoryList> selectValueAndLabelAndChildren(@Param("level") String level, @Param("deleted") Boolean deleted);

    Category selectFirstCategory();

    List<Category> selectSubCategory();

    List<Category> selectSubCategoryById(Integer id);
}